#ifndef WS2812B_H
#define WS2812B_H

#define WS2812_LED_NUM 5

#define WS2812_PORT GPIOC
#define WS2812_PIN GPIO_PIN_6

#define WS2812_PIN_H() GPIOC->ODR |= (uint8_t)GPIO_PIN_6;
// GPIOx->ODR |= (uint8_t)PortPins;

#define WS2812_PIN_L() GPIOC->ODR &= (uint8_t)(~GPIO_PIN_6);
// GPIOx->ODR &= (uint8_t)(~PortPins);

#define delay1NOP() _nop_()
#define delay2NOP() delay1NOP();_nop_();
#define delay3NOP() delay2NOP();_nop_();
#define delay4NOP() delay3NOP();_nop_();
#define delay5NOP() delay4NOP();_nop_();
#define delay6NOP() delay5NOP();_nop_();
#define delay7NOP() delay6NOP();_nop_();
#define delay8NOP() delay7NOP();_nop_();
#define delay9NOP() delay8NOP();_nop_();
#define delay10NOP() delay9NOP();_nop_();
#define delay11NOP() delay10NOP();_nop_();
#define delay12NOP() delay11NOP();_nop_();
#define delay13NOP() delay12NOP();_nop_();
#define delay14NOP() delay13NOP();_nop_();
#define delay15NOP() delay14NOP();_nop_();

#define SIG_1   0xf8
#define SIG_0   0xe0

void ws2812b_gpio_init(void);
void ws2812b_init(void);
void ws2812b_reset(void);

void rgb_write_data(u8 green, u8 red, u8 blue);

void ws2812b_write(uint32_t color);

void ws2812b_send_data(u8 green, u8 red, u8 blue);

void ws2812b_set_rgb_for_onelamp(uint8_t red, uint8_t green, uint8_t blue);

void Ws2812b_all_shutoff(void);
void set_color_5(uint32_t color);

void rgb_refresh(u32 color, u8 num);
void rbg_flash(u32 color, u8 num, u16 speed, u8 cnt);



#endif